home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / battlnts.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  18KB  |  467 lines

  1. /***************************************************************************
  2.  
  3. Battlantis(GX777) (c) 1987 Konami
  4.  
  5. Preliminary driver by:
  6.     Manuel Abadia <manu@teleline.es>
  7.  
  8. ***************************************************************************/
  9.  
  10. #include "driver.h"
  11. #include "cpu/m6809/m6809.h"
  12. #include "vidhrdw/generic.h"
  13. #include "cpu/z80/z80.h"
  14. #include "vidhrdw/konamiic.h"
  15.  
  16. /* from vidhrdw */
  17. WRITE_HANDLER( battlnts_spritebank_w );
  18. int battlnts_vh_start(void);
  19. void battlnts_vh_stop(void);
  20. void battlnts_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  21.  
  22. static int battlnts_interrupt( void )
  23. {
  24.     if (K007342_is_INT_enabled())
  25.         return HD6309_INT_IRQ;
  26.     else
  27.         return ignore_interrupt();
  28. }
  29.  
  30. WRITE_HANDLER( battlnts_sh_irqtrigger_w )
  31. {
  32.     cpu_cause_interrupt(1,0xff);
  33. }
  34.  
  35. static WRITE_HANDLER( battlnts_bankswitch_w )
  36. {
  37.     unsigned char *RAM = memory_region(REGION_CPU1);
  38.     int bankaddress;
  39.  
  40.     /* bits 6 & 7 = bank number */
  41.     bankaddress = 0x10000 + ((data & 0xc0) >> 6) * 0x4000;
  42.     cpu_setbank(1,&RAM[bankaddress]);
  43.  
  44.     /* bits 4 & 5 = coin counters */
  45.     coin_counter_w(0,data & 0x10);
  46.     coin_counter_w(1,data & 0x20);
  47.  
  48.     /* other bits unknown */
  49. }
  50.  
  51. static struct MemoryReadAddress battlnts_readmem[] =
  52. {
  53.     { 0x0000, 0x1fff, K007342_r },            /* Color RAM + Video RAM */
  54.     { 0x2000, 0x21ff, K007420_r },            /* Sprite RAM */
  55.     { 0x2200, 0x23ff, K007342_scroll_r },    /* Scroll RAM */
  56.     { 0x2400, 0x24ff, paletteram_r },        /* Palette */
  57.     { 0x2e00, 0x2e00, input_port_0_r },        /* DIPSW #1 */
  58.     { 0x2e01, 0x2e01, input_port_4_r },        /* 2P controls */
  59.     { 0x2e02, 0x2e02, input_port_3_r },        /* 1P controls */
  60.     { 0x2e03, 0x2e03, input_port_2_r },        /* coinsw, testsw, startsw */
  61.     { 0x2e04, 0x2e04, input_port_1_r },        /* DISPW #2 */
  62.     { 0x4000, 0x7fff, MRA_BANK1 },            /* banked ROM */
  63.     { 0x8000, 0xffff, MRA_ROM },            /* ROM 777e02.bin */
  64.     { -1 }    /* end of table */
  65. };
  66.  
  67. static struct MemoryWriteAddress battlnts_writemem[] =
  68. {
  69.     { 0x0000, 0x1fff, K007342_w },                /* Color RAM + Video RAM */
  70.     { 0x2000, 0x21ff, K007420_w },                /* Sprite RAM */
  71.     { 0x2200, 0x23ff, K007342_scroll_w },        /* Scroll RAM */
  72.     { 0x2400, 0x24ff, paletteram_xBBBBBGGGGGRRRRR_swap_w, &paletteram },/* palette */
  73.     { 0x2600, 0x2607, K007342_vreg_w },            /* Video Registers */
  74.     { 0x2e08, 0x2e08, battlnts_bankswitch_w },    /* bankswitch control */
  75.     { 0x2e0c, 0x2e0c, battlnts_spritebank_w },    /* sprite bank select */
  76.     { 0x2e10, 0x2e10, watchdog_reset_w },        /* watchdog reset */
  77.     { 0x2e14, 0x2e14, soundlatch_w },            /* sound code # */
  78.     { 0x2e18, 0x2e18, battlnts_sh_irqtrigger_w },/* cause interrupt on audio CPU */
  79.     { 0x4000, 0x7fff, MWA_ROM },                /* banked ROM */
  80.     { 0x8000, 0xffff, MWA_ROM },                /* ROM 777e02.bin */
  81.     { -1 }    /* end of table */
  82. };
  83.  
  84. static struct MemoryReadAddress battlnts_readmem_sound[] =
  85. {
  86.     { 0x0000, 0x7fff, MRA_ROM },                /* ROM 777c01.rom */
  87.     { 0x8000, 0x87ff, MRA_RAM },                /* RAM */
  88.     { 0xa000, 0xa000, YM3812_status_port_0_r },    /* YM3812 (chip 1) */
  89.     { 0xc000, 0xc000, YM3812_status_port_1_r },    /* YM3812 (chip 2) */
  90.     { 0xe000, 0xe000, soundlatch_r },            /* soundlatch_r */
  91.     { -1 }    /* end of table */
  92. };
  93.  
  94. static struct MemoryWriteAddress battlnts_writemem_sound[] =
  95. {
  96.     { 0x0000, 0x7fff, MWA_ROM },                    /* ROM 777c01.rom */
  97.     { 0x8000, 0x87ff, MWA_RAM },                    /* RAM */
  98.     { 0xa000, 0xa000, YM3812_control_port_0_w },    /* YM3812 (chip 1) */
  99.     { 0xa001, 0xa001, YM3812_write_port_0_w },        /* YM3812 (chip 1) */
  100.     { 0xc000, 0xc000, YM3812_control_port_1_w },    /* YM3812 (chip 2) */
  101.     { 0xc001, 0xc001, YM3812_write_port_1_w },        /* YM3812 (chip 2) */
  102.     { -1 }    /* end of table */
  103. };
  104.  
  105. /***************************************************************************
  106.  
  107.     Input Ports
  108.  
  109. ***************************************************************************/
  110.  
  111. INPUT_PORTS_START( battlnts )
  112.     PORT_START    /* DSW #1 */
  113.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  114.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  115.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  116.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  117.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  118.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  119.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  120.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  121.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  122.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  123.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  124.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  125.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  126.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  127.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  128.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  129.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  130.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  131.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  132.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  133.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  134.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  135.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  136.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  137.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  138.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  139.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  140.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  141.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  142.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  143.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  144.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  145.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  146. //    PORT_DIPSETTING(    0x00, "Invalid" )
  147.  
  148.     PORT_START    /* DSW #2 */
  149.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
  150.     PORT_DIPSETTING(    0x03, "2" )
  151.     PORT_DIPSETTING(    0x02, "3" )
  152.     PORT_DIPSETTING(    0x01, "5" )
  153.     PORT_DIPSETTING(    0x00, "7" )
  154.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  155.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  156.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  157.     PORT_DIPNAME( 0x18, 0x10, DEF_STR( Bonus_Life ) )
  158.     PORT_DIPSETTING(    0x18, "30k and every 70k" )
  159.     PORT_DIPSETTING(    0x10, "40k and every 80k" )
  160.     PORT_DIPSETTING(    0x08, "40k" )
  161.     PORT_DIPSETTING(    0x00, "50k" )
  162.     PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
  163.     PORT_DIPSETTING(    0x60, "Easy" )
  164.     PORT_DIPSETTING(    0x40, "Normal" )
  165.     PORT_DIPSETTING(    0x20, "Difficult" )
  166.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  167.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  168.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  169.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  170.  
  171.     PORT_START    /* COINSW */
  172.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  173.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  174.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  175.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  176.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  177.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
  178.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  179.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  180.     PORT_DIPNAME( 0x40, 0x40, "Upright Controls" )
  181.     PORT_DIPSETTING(    0x40, "Single" )
  182.     PORT_DIPSETTING(    0x00, "Dual" )
  183.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  184.  
  185.     PORT_START    /* PLAYER 1 INPUTS */
  186.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  187.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  188.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  189.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  190.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  191.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  192.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  193.     PORT_DIPNAME( 0x80, 0x80, "Continue limit" )
  194.     PORT_DIPSETTING(    0x80, "3" )
  195.     PORT_DIPSETTING(    0x00, "5" )
  196.  
  197.     PORT_START    /* PLAYER 2 INPUTS */
  198.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  199.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  200.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  201.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  202.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  203.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  204.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  205.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  206. INPUT_PORTS_END
  207.  
  208. INPUT_PORTS_START( thehustj )
  209.     PORT_START    /* DSW #1 */
  210.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  211.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  212.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  213.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  214.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  215.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  216.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  217.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  218.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  219.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  220.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  221.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  222.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  223.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  224.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  225.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  226.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  227.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  228.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  229.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  230.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  231.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  232.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  233.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  234.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  235.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  236.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  237.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  238.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  239.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  240.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  241.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  242.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  243. //    PORT_DIPSETTING(    0x00, "Invalid" )
  244.  
  245.     PORT_START    /* DSW #2 */
  246.     PORT_DIPNAME( 0x03, 0x02, "Balls" )
  247.     PORT_DIPSETTING(    0x03, "1" )
  248.     PORT_DIPSETTING(    0x02, "2" )
  249.     PORT_DIPSETTING(    0x01, "3" )
  250.     PORT_DIPSETTING(    0x00, "6" )
  251.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  252.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  253.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  254.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  255.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  256.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  257.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  258.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  259.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  260.     PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
  261.     PORT_DIPSETTING(    0x60, "Easy" )
  262.     PORT_DIPSETTING(    0x40, "Normal" )
  263.     PORT_DIPSETTING(    0x20, "Difficult" )
  264.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  265.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  266.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  267.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  268.  
  269.     PORT_START    /* COINSW */
  270.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  271.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  272.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  273.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  274.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  275.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
  276.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  277.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  278.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  279.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  280.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  281.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  282.  
  283.     PORT_START    /* PLAYER 1 INPUTS */
  284.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  285.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  286.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  287.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  288.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  289.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  290.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  291.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  292.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  293.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  294.  
  295.     PORT_START    /* PLAYER 2 INPUTS */
  296.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  297.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  298.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  299.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  300.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  301.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  302.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  303.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  304. INPUT_PORTS_END
  305.  
  306.  
  307. static struct GfxLayout charlayout =
  308. {
  309.     8,8,            /* 8 x 8 characters */
  310.     0x40000/32,        /* 8192 characters */
  311.     4,                /* 4bpp */
  312.     { 0, 1, 2, 3 },    /* the four bitplanes are packed in one nibble */
  313.     { 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4 },
  314.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  315.     32*8            /* every character takes 32 consecutive bytes */
  316. };
  317.  
  318. static struct GfxLayout spritelayout =
  319. {
  320.     8,8,            /* 8*8 sprites */
  321.     0x40000/32,    /* 8192 sprites */
  322.     4,                /* 4 bpp */
  323.     { 0, 1, 2, 3 },    /* the four bitplanes are packed in one nibble */
  324.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4},
  325.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  326.     32*8            /* every sprite takes 32 consecutive bytes */
  327. };
  328.  
  329.  
  330. static struct GfxDecodeInfo gfxdecodeinfo[] =
  331. {
  332.     { REGION_GFX1, 0, &charlayout,      0, 1 },    /* colors  0-15 */
  333.     { REGION_GFX2, 0, &spritelayout, 4*16, 1 },    /* colors 64-79 */
  334.     { -1 } /* end of array */
  335. };
  336.  
  337. /***************************************************************************
  338.  
  339.     Machine Driver
  340.  
  341. ***************************************************************************/
  342.  
  343. static struct YM3812interface ym3812_interface =
  344. {
  345.     2,                /* 2 chips */
  346.     3000000,         /* ? */
  347.     { 50, 50 },
  348.     { 0, 0 },
  349. };
  350.  
  351. static struct MachineDriver machine_driver_battlnts =
  352. {
  353.     /* basic machine hardware */
  354.     {
  355.         {
  356.             CPU_HD6309,
  357.             3000000,        /* ? */
  358.             battlnts_readmem,battlnts_writemem,0,0,
  359.             battlnts_interrupt,1
  360.         },
  361.         {
  362.             CPU_Z80 | CPU_AUDIO_CPU,
  363.             3579545,        /* ? */
  364.             battlnts_readmem_sound, battlnts_writemem_sound,0,0,
  365.             ignore_interrupt,0    /* interrupts are triggered by the main CPU */
  366.         }
  367.     },
  368.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  369.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  370.     0,
  371.  
  372.     /* video hardware */
  373.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  374.     gfxdecodeinfo,
  375.     128, 128,
  376.     0,
  377.  
  378.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  379.     0,
  380.     battlnts_vh_start,
  381.     battlnts_vh_stop,
  382.     battlnts_vh_screenrefresh,
  383.  
  384.     /* sound hardware */
  385.     0,0,0,0,
  386.     {
  387.         {
  388.             SOUND_YM3812,
  389.             &ym3812_interface
  390.         }
  391.     }
  392. };
  393.  
  394.  
  395. /***************************************************************************
  396.  
  397.   Game ROMs
  398.  
  399. ***************************************************************************/
  400.  
  401. ROM_START( battlnts )
  402.     ROM_REGION( 0x20000, REGION_CPU1 ) /* code + banked roms */
  403.     ROM_LOAD( "g02.7e",      0x08000, 0x08000, 0xdbd8e17e )    /* fixed ROM */
  404.     ROM_LOAD( "g03.8e",      0x10000, 0x10000, 0x7bd44fef )    /* banked ROM */
  405.  
  406.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the sound CPU */
  407.     ROM_LOAD( "777c01.bin",  0x00000, 0x08000, 0xc21206e9 )
  408.  
  409.     ROM_REGION( 0x40000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  410.     ROM_LOAD( "777c04.bin",     0x00000, 0x40000, 0x45d92347 )    /* tiles */
  411.  
  412.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  413.     ROM_LOAD( "777c05.bin",     0x00000, 0x40000, 0xaeee778c )    /* sprites */
  414. ROM_END
  415.  
  416. ROM_START( battlntj )
  417.     ROM_REGION( 0x20000, REGION_CPU1 ) /* code + banked roms */
  418.     ROM_LOAD( "777e02.bin",  0x08000, 0x08000, 0xd631cfcb )    /* fixed ROM */
  419.     ROM_LOAD( "777e03.bin",  0x10000, 0x10000, 0x5ef1f4ef )    /* banked ROM */
  420.  
  421.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the sound CPU */
  422.     ROM_LOAD( "777c01.bin",  0x00000, 0x08000, 0xc21206e9 )
  423.  
  424.     ROM_REGION( 0x40000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  425.     ROM_LOAD( "777c04.bin",     0x00000, 0x40000, 0x45d92347 )    /* tiles */
  426.  
  427.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  428.     ROM_LOAD( "777c05.bin",     0x00000, 0x40000, 0xaeee778c )    /* sprites */
  429. ROM_END
  430.  
  431. ROM_START( thehustl )
  432.     ROM_REGION( 0x20000, REGION_CPU1 ) /* code + banked roms */
  433.     ROM_LOAD( "765-m02.7e",  0x08000, 0x08000, 0x934807b9 )    /* fixed ROM */
  434.     ROM_LOAD( "765-j03.8e",  0x10000, 0x10000, 0xa13fd751 )    /* banked ROM */
  435.  
  436.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the sound CPU */
  437.     ROM_LOAD( "765-j01.10a", 0x00000, 0x08000, 0x77ae753e )
  438.  
  439.     ROM_REGION( 0x40000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  440.     ROM_LOAD( "765-e04.13a", 0x00000, 0x40000, 0x08c2b72e )    /* tiles */
  441.  
  442.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  443.     ROM_LOAD( "765-e05.13e", 0x00000, 0x40000, 0xef044655 )    /* sprites */
  444. ROM_END
  445.  
  446. ROM_START( thehustj )
  447.     ROM_REGION( 0x20000, REGION_CPU1 ) /* code + banked roms */
  448.     ROM_LOAD( "765-j02.7e",  0x08000, 0x08000, 0x2ac14c75 )    /* fixed ROM */
  449.     ROM_LOAD( "765-j03.8e",  0x10000, 0x10000, 0xa13fd751 )    /* banked ROM */
  450.  
  451.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the sound CPU */
  452.     ROM_LOAD( "765-j01.10a", 0x00000, 0x08000, 0x77ae753e )
  453.  
  454.     ROM_REGION( 0x40000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  455.     ROM_LOAD( "765-e04.13a", 0x00000, 0x40000, 0x08c2b72e )    /* tiles */
  456.  
  457.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  458.     ROM_LOAD( "765-e05.13e", 0x00000, 0x40000, 0xef044655 )    /* sprites */
  459. ROM_END
  460.  
  461.  
  462.  
  463. GAME( 1987, battlnts, 0,        battlnts, battlnts, 0, ROT90, "Konami", "Battlantis" )
  464. GAME( 1987, battlntj, battlnts, battlnts, battlnts, 0, ROT90, "Konami", "Battlantis (Japan)" )
  465. GAME( 1987, thehustl, 0,        battlnts, thehustj, 0, ROT90, "Konami", "The Hustler (Japan version M)" )
  466. GAME( 1987, thehustj, thehustl, battlnts, thehustj, 0, ROT90, "Konami", "The Hustler (Japan version J)" )
  467.